package de.ubschmidt.capi;

public enum Flag {

    QUALIFIER(0),

    MORE_DATA(1),

    DELIVERY_CONFIRMATION(2),

    EXPEDITED_DATA(3),

    BREAK_UI_FRAME(4),

    FRAMING_ERROR(15);

    private int _value;

    Flag(final int value) {
        _value = value;
    }

    /**
     * Retrieve the bit number of this enum.
     *
     * @return The bit number.
     */
    public int getValue() {
        return _value;
    }

    /** {@inheritDoc} */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();

        sb.append(name());
        sb.append("(").append(getValue()).append(")");

        return sb.toString();
    }

}
